import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

// 路由懒加载  和 路径的结构调整

// 登录页面
const index = (resolve) => require(['@/pages'], resolve)
// 内容共公主体
const content = (resolve) => require(['@/pages/content'], resolve)
const account = (resolve) => require(['@/pages/content/account'], resolve)

export default new Router({
  routes: [
    {
      path: '/pages',
      name: 'index',
      meta: {
        level: 'lev'
      },
      component: index
    },
    {
      path: '/pages/content',
      name: 'content',
      component: content,
      meta: {
        level: 'con'
      },
      children: [
        {
          path: 'account',
          name: 'account',
          component: account
        }
      ]
    },
    {
      path: '*',
      redirect: '/pages'
    }
  ]
})
